#!/usr/bin/env python

PACKAGE = "xtsdk_ros"

from dynamic_reconfigure.parameter_generator_catkin import *

gen = ParameterGenerator()

cloud_coord_enum  =  gen.enum([ gen.const("Left_Up_Front",      int_t, 0, "Left Up Front"),
                             gen.const("Front_Left_Up", int_t, 1, "Front Left Up")],
                             "An enum to set coordination mode")

image_type_enum = gen.enum([ gen.const("Distance", int_t, 0, "Distance"),
                             gen.const("DistranceAmplitude",    int_t, 1, "DistranceAmplitude"),
                             gen.const("Grayscale", int_t, 2, "Grayscale"),
                             gen.const("Pointcloud", int_t, 3, "Pointcloud"),
                             gen.const("PointcloudAmp", int_t, 4, "PointcloudAmp")],
                             "An enum to set image type")


hdr_mode_enum  =  gen.enum([ gen.const("HDR_off",      int_t, 0, "HDR off"),
                             gen.const("HDR_temporal", int_t, 1, "HDR temporal")],
                             "An enum to set HDR mode")


frequence_modulation_enum = gen.enum([ gen.const("12MHz", int_t, 0, "12MHz"),
                                       gen.const("6MHz", int_t, 1, "6MHz"),
									   gen.const("24MHz", int_t, 2, "24MHz"),
                                       gen.const("3MHz", int_t, 3, "3MHz"),
                                       gen.const("1_5MHz", int_t, 4, "1.5MHz"),
									   gen.const("0_75MHz", int_t, 5, "0.75MHz"),
                                       gen.const("4_8MHz", int_t, 6, "4.8MHz")],
                                       "An enum to set modulation frequency")


######  Name                    Type   recfg-level  Description     		Default Min  Max

gen.add("imgType",             int_t,  0,  	"Image type", 				4, 0, 4, edit_method=image_type_enum)
gen.add("start_stream",           bool_t, 0,  	"Start / Stop image acquisition",  True)
gen.add("usb_com",           bool_t, 1,  	"SET USB",  True)
gen.add("usb_com_name",        str_t,  0,  	"usb com name", "/dev/ttyACM0")
gen.add("HDR",               int_t,  0, 	"HDR mode", 				1, 0, 1, edit_method=hdr_mode_enum)
gen.add("cloud_coord",               int_t,  0, 	"coordination mode", 				1, 0, 1, edit_method=cloud_coord_enum)
gen.add("gray_on",           bool_t, 1,  	"SET USB",  False)
gen.add("is_use_devconfig",           bool_t, 1,  	"is_use_devconfig",  True)


gen.add("int1", int_t,  0,  	"Integration time TOF1 [uS]",        100,  0, 2000)
gen.add("freq1",   int_t,  0,  	"Frequency modulation1", 	2, 0, 6, edit_method=frequence_modulation_enum)
gen.add("int2", int_t,  0,  	"Integration time TOF2 [uS]",       1000,  0, 2000)
gen.add("freq2",   int_t,  0,  	"Frequency modulation2", 	0, 0, 6, edit_method=frequence_modulation_enum)
gen.add("int3", int_t,  0,  	"Integration time TOF3 [uS]",          0,  0, 2000)
gen.add("freq3",   int_t,  0,  	"Frequency modulation3", 	1, 0, 6, edit_method=frequence_modulation_enum)
gen.add("int4", int_t,  0,  	"Integration time TOF4 [uS]",          0,  0, 2000)
gen.add("freq4",   int_t,  0,  	"Frequency modulation4", 	1, 0, 6, edit_method=frequence_modulation_enum)

gen.add("intgs",  int_t,  0,  	"Integration time Grayscale [uS]",  2000,  0, 40000)
gen.add("minLSB",          int_t,  0,  	"threshold minAmplitude LSB",        80,   0, 2000)
gen.add("freq",   int_t,  0,  	"Frequency modulation", 	1, 0, 2, edit_method=frequence_modulation_enum)

gen.add("cut_corner",              int_t,  0,  	"Cut Corner",        60,   0, 120)
gen.add("maxfps",              int_t,  0,  	"maxfps",        30,   0, 60)
gen.add("connect_address",        str_t,  0,  	"connect address ip/serial", "192.168.0.117")
gen.add("frame_id",        str_t,  0,  	"lidar frame id", "sensor_frame")
gen.add("topic_name",        str_t,  0,  	"topic name", "points")



exit(gen.generate(PACKAGE, "xtsdk_ros", "xtsdk_ros1"))

